
function updateOneInfo(num,info_id,pub_date) { 
		document.getElementById('updateThisInfo'+num).innerHTML = '<img src="/program/admin/images/wait.gif"/>';
		jQuery.ajax( {
			   type: 'POST',
			   url: 'updateOneInfo.jsp',
			   data: 'info_id='+info_id+'&pub_date='+pub_date+'&num='+num,
			   success: function(msg){
					document.getElementById('updateThisInfo'+num).innerHTML=msg;
				 }
			}); 
	}

function checkSub(){
	
	if(document.getElementById('title').value==''){
		alert('标题不能为空');
		document.getElementById('title').focus();
		return false;
	}
	
	if(document.getElementById('contents').value==''){
		alert('内容不能为空');
		document.getElementById('contents').focus();
		return false;
	}
	if(document.getElementById('flag_code').value == "1")
	{
	   if(document.getElementById("s_cat_attr").value=="")
	   {
		  alert("请选择所属分类！");
		  document.getElementById('s_cat_attr').focus();
		  return false;
	   }
	   document.getElementById("class_attr").value = document.getElementById("s_cat_attr").value;
	   
    }
	document.addForm.submit();
}

function search(){
	var class_attr=""; 
  if(document.getElementById("sort1").value!="")
  {
      class_attr = document.getElementById("sort1").value+"|"; 
  }

  if(document.getElementById("sort2").value!="")
  {
      class_attr += document.getElementById("sort2").value+"|"; 
  }

  if(document.getElementById("sort3").value!="")
  {
      class_attr += document.getElementById("sort3").value+"|"; 
  }
  document.getElementById("req_class_attr").value = class_attr;
  document.indexForm.submit();
}
function ChangeClassStyle(){
	document.getElementById("flag_code").value = "1";
	document.getElementById("classId1").style.display="none";
	document.getElementById("classId2").style.display="block";
}

var type = "2";

function setSecondClass(val) {
  $("class_id_group").value ="";
	var up_class_id = val;
	Ts_categoryInfo.getCatClassByUpId(up_class_id, type, setSort2);
}

function setSort2(map_data) {
 	DWRUtil.removeAllOptions("sort2");
	DWRUtil.addOptions("sort2", map_data);
	$("sort3").style.display = "none";
	var item = $("sort2").length;
	if (item == 0) {
		$("sort2").style.display = "none";
	} else {
		$("sort2").style.display = "inline";
	}
}
// 设置三级分类
function setTherdClass(val) {
 
 
  $("class_id_group").value ="";

	var up_class_id = val;
	
	Ts_categoryInfo.getCatClassByUpId(up_class_id, type, setSort3);
}
function setSort3(map_data) {
  
	if (map_data != null) {
		DWRUtil.removeAllOptions("sort3");
		DWRUtil.addOptions("sort3", map_data);
		var item = $("sort3").length;
		if (item == 0) {
			$("sort3").style.display = "none";
		} else {
			$("sort3").style.display = "inline";
		}
	}
}


function updatestate(val){
	var listsize = document.getElementById('listsize').value;
	var pkid_string = '';
	for(var i=0;i<listsize;i++){
		if(document.getElementById('checkone'+i).checked){
			pkid_string += document.getElementById('checkone'+i).value+'|';
		}
	}
	document.getElementById('pkid').value = pkid_string;
	if(pkid_string == ''){
		alert('请选择要操作的信息!');
		return false;
	}
	
	    document.getElementById('pkid').value = pkid_string;
		document.getElementById('state_code').value = val;
		document.indexForm.action='/doTradeReg.do';
		document.getElementById('bpm_id').value = '2588';
		if(window.confirm('确认提交吗?'))
		{
			document.indexForm.submit();
		}
	
}